<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <title>稻稻工厂后台管理</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/bootstrap-responsive.min.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/colorpicker.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/datepicker.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/uniform.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/select2.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/matrix-style.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/matrix-media.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/bootstrap-wysihtml5.css" />
    <link href="/thinkphp/Public/admin/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href='http://fonts.useso.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
    <script src="/thinkphp/Public/admin/js/jquery.min.js"></script>
    <style>
        .floatWindow{
            background:#000;
            width:100%;
            height:110%;
            position: absolute;
            z-index:999;
            /* older safari/Chrome browsers */
            -webkit-opacity: 0.8;
            /* Netscape and Older than Firefox 0.9 */
            -moz-opacity: 0.8;
            /* Safari 1.x (pre WebKit!) 老式khtml内核的Safari浏览器*/
            -khtml-opacity: 0.8;
            /* IE9 + etc...modern browsers */
            opacity: .8;
            /* IE 4-9 */
            filter:alpha(opacity=80);
            /*This works in IE 8 & 9 too*/
            -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
            /*IE4-IE9*/
            filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
            color:#FFFFFF;
            display:none;
        }
        .floatWindow ul{
            margin:0 auto;
            list-style:none;
            width:90%;
            margin-top:5%;
        }
        .floatWindow ul li{
            margin-top:20px;
            font-size:12px;
            color:#939DA8;
        }
        .floatWindow ul li span{
            width:100%;
            float:left;
            color:#FFFFFF;;
            font-weight:900;
            font-size:12px;
            text-align: center;;
        }
    </style>
</head>

<body>
<!--Header-part-->
<div id="header">
  <h1><a href="dashboard.html">稻道工厂</a></h1>
</div>
<!--close-Header-part--> 

<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
  <ul class="nav">
        <li class=""><a title="" href="<?php echo U('Login/index');?>"><i class="icon icon-cog"></i> <span class="text">欢迎 <?php echo ($AdminUser); ?></span></a></li>
        <li class=""><a title="" href="<?php echo U('Login/index');?>"><i class="icon icon-cog"></i> <span class="text">登录</span></a></li>
        <li class=""><a title="" href="<?php echo U('Login/outLogin');?>"><i class="icon icon-share-alt"></i> <span class="text">登出</span></a></li>
  </ul>
</div>
<!--sidebar-menu-->
<div id="sidebar">
  <ul>
    <li>
        <a href="#"><i class="icon icon-list"></i> <span>用户</span></a>
    </li>
    <ul>
        <li><a href="<?php echo U('User/index');?>">用户</a></li>
    </ul>
    <li>
        <a href="#"><i class="icon icon-list"></i> <span>商品</span></a>
    </li>
    <ul>
        <li><a href="<?php echo U('Goods/index');?>">列表</a></li>
        <li><a href="<?php echo U('Goods/addGoods');?>">添加</a></li>
    </ul>

    <li>
        <a href="#"><i class="icon icon-list"></i> <span>栏目</span></a>
    </li>
    <ul>
    <!--<li><a href="<?php echo U('Cate/index');?>">列表</a></li>-->
        <li><a href="<?php echo U('Cate/addCate');?>">添加</a></li>
    </ul>

    <li>
        <a href="#"><i class="icon icon-list"></i><span>订单</span></a>
    </li>
    <ul>
      <li>
          <a href="<?php echo U('Order/index');?>">查看订单列表</a>
      </li>
    </ul>

    <li>
        <a href="#"><i class="icon icon-list"></i> <span>后台管理</span></a>
    </li>
    <ul>
        <li><a href="<?php echo U('Manage/index');?>">人员</a></li>
    </ul>

    <li>
        <a href="#"><i class="icon icon-list"></i> <span>商户</span></a>
    </li>
    <ul>
        <li><a href="<?php echo U('BusinessMan/index');?>">商户列表</a></li>
        <li><a href="<?php echo U('BusinessMan/addMan');?>">添加商户</a></li>
    <!--<li><a href="<?php echo U('BusinessMan/auth');?>">权限</a></li>-->
    </ul>
</div>

<!--close-left-menu-stats-sidebar-->

<div id="content">

    <div class="container-fluid">
    <hr>
    <div class="row-fluid">
      <div class="span12">

        <div class="controls controls-row">
          <form name="orderCond" method="post">
                <input style="display:none;" type="text" value="<?php echo U('Order/index?condition=1');?>" name="pay_status_b" />
                <input style="display:none;" type="text" value="<?php echo U('Order/index?condition=2');?>" name="pay_type_b" />
                <input style="display:none;" type="text" value="<?php echo U('Order/index?condition=3');?>" name="time" />
                <input style="display:none;" type="text" value="<?php echo U('Order/index?condition=4');?>" name="order_sn_b" />
                <input style="display:none;" type="text" value="<?php echo U('Order/index?condition=5');?>" name="sellerID_b" />
                <input style="display:none;" type="text" value="<?php echo U('Order/index?condition=6');?>" name="order_status_b" />

                <a class="btn btn-primary" style="float:left;" href="<?php echo U('Order/index');?>">所有信息</a>

              <select name="order_status" class="span2" onchange="sub_pay_status(6)">
                  <option selected="selected"> -- 订单状态 -- </option>
                  <option value="0">未成功</option>
                  <option value="2">成功</option>
              </select>
              <script>
                  var order_status=<?php echo ($order_status); ?>;
                  if(typeof(order_status)=='number'){
                      $("select[name='order_status']").children("option").each(
                              function(){
                                  if($(this).val()==order_status)
                                  {
                                      $(this).attr("selected","selected");
                                  }
                              }
                      );
                  }
              </script>

                <select name="pay_status" class="span2" onchange="sub_pay_status(1)">
                    <option selected="selected"> -- 支付状态 -- </option>
                    <option value="0">未付款</option>
                    <option value="1">付款中</option>
                    <option value="2">已付款</option>
                    <option value="all">全部订单</option>
                </select>
                  <script>
                      var pay_status=<?php echo ($pay_status); ?>;
                      if(typeof(pay_status)=='number'){
                          $("select[name='pay_status']").children("option").each(
                                  function(){
                                      if($(this).val()==pay_status)
                                      {
                                          $(this).attr("selected","selected");
                                      }
                                  }
                          );
                      }
                  </script>
                <select name="pay_type" class="span2" onchange="sub_pay_status(2)">
                    <option selected="selected"> -- 支付方式 -- </option>
                    <option value="0">货到付款</option>
                    <option value="1">微信支付</option>
                    <option value="2">门店自提</option>
                    <option value="all">全部订单</option>
                </select>
                  <script>
                      var pay_type=<?php echo ($pay_type); ?>;
                      if(typeof(pay_type)=='number') {
                          $("select[name='pay_type']").children("option").each(
                                  function(){
                                      if($(this).val()==pay_type)
                                      {
                                          $(this).attr("selected","selected");
                                      }
                                  }
                          );
                      }
                  </script>
                <input name="order_sn" class="span2" value="" onblur="sub_pay_status(4)" placeholder="订单编码"/>

                <input style="width:100px;" name="endTime" readonly="readonly" type="text" data-date-format="mm-dd-yyyy" class="datepicker span2" placeholder="时间范围(止)" onclick="sub_pay_status(3)">
                <input style="width:100px;" name="startTime" readonly="readonly" type="text" data-date-format="mm-dd-yyyy" class="datepicker span2" placeholder="时间范围(起)" onclick="sub_pay_status(3)">


                <div style="border:1px solid #FFFFFF; margin-top:10px; float:left; width:100%;">
                    <label>用于商户对账</label>
                    <input name="startTime_b" readonly="readonly" type="text" data-date-format="mm-dd-yyyy" class="datepicker span2" placeholder="时间范围(起)">
                    <input name="endTime_b" readonly="readonly" type="text" data-date-format="mm-dd-yyyy" class="datepicker span2" placeholder="时间范围(止)">
                    <select name="sellerID" class="span2">
                        <option selected="selected"> -- 商户 -- </option>
                        <?php if(is_array($seller)): $i = 0; $__LIST__ = $seller;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$ko): $mod = ($i % 2 );++$i;?><option value="<?php echo ($ko["id"]); ?>"><?php echo ($ko["nick"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    <input type="button" value="提交" onclick="sub_pay_status(5)"/>
                </div>

          </form>
        </div>
        <script>
            function sub_pay_status(action)
            {

                if(action==1)
                {
                    var url=$("input[name='pay_status_b']").val();
                    document.orderCond.action=url;
                    orderCond.submit();
                }
                else if(action==2)
                {
                    var url=$("input[name='pay_type_b']").val();
                    document.orderCond.action=url;
                    orderCond.submit();
                }
                else if(action==3)
                {
                    var startTime=$("input[name='startTime']").val();
                    var endTime=$("input[name='endTime']").val();
                    if(startTime!=""&&endTime!="")
                    {
                        var url=$("input[name='time']").val();
                        document.orderCond.action=url;
                        orderCond.submit();
                    }
                }
                else if(action==4)
                {
                    if($("input[name='order_sn']").val()!="")
                    {
                        var url = $("input[name='order_sn_b']").val();
                        document.orderCond.action = url;
                        orderCond.submit();
                    }
                }
                else if(action==5)
                {
                    var startTimeB=$("input[name='startTime_b']").val();
                    var endTimeB=$("input[name='endTime_b']").val();
                    var sellerID=$("input[name='seller']").val();
                    if(startTimeB!=""&&endTimeB!=""&&sellerID!="")
                    {
                        var url=$("input[name='sellerID_b']").val();
                        document.orderCond.action=url;
                        orderCond.submit();
                    }
                }
                else if(action==6)
                {
                    if($("input[name='order_status']").val()!="")
                    {
                        var url = $("input[name='order_status_b']").val();
                        document.orderCond.action = url;
                        orderCond.submit();
                    }
                }
            }

        </script>
        <div class="widget-box">
          <div class="widget-title"><span class="icon">
            <input type="checkbox" id="title-checkbox" name="title-checkbox" />
            </span>
            <h5>Static table with checkboxes</h5>
          </div>
          <div class="widget-content nopadding">
            <table class="table table-bordered table-striped with-check">
                  <thead>
                        <tr>
                            <th><i class="icon-resize-vertical"></i></th>
                            <th>ID</th>
                            <th>order_sn</th>
                            <th>购买者</th>
                            <th>订单状态</th>
                            <th>支付状态</th>
                            <th>支付方式</th>
                            <th>下单时间</th>
                            <th>地址</th>
                        </tr>
                  </thead>

                <?php if(is_array($arr)): $i = 0; $__LIST__ = $arr;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tbody>
                        <tr>
                            <td><input type="checkbox" /></td>
                            <td><?php echo ($vo["id"]); ?></td>
                            <td><a href="<?php echo U('Order/orderInfo',array('id'=>$vo[id]));?>"><?php echo ($vo["order_sn"]); ?></a></td>
                            <td class="center"><?php echo ($vo["username"]); ?></td>
                            <td><?php echo ($vo["order_status_b"]); ?></td>
                            <td><?php echo ($vo["pay_status_b"]); ?></td>
                            <td><?php echo ($vo["pay_type_b"]); ?></td>
                            <td><?php echo ($vo["add_time_b"]); ?></td>
                            <td><?php echo ($vo["address"]); ?></td>
                        </tr>
                    </tbody><?php endforeach; endif; else: echo "" ;endif; ?>
                总价钱：<?php echo ($sumAmount); ?> | 订单数量：<?php echo ($countOrderNum); ?>
            </table>
              <script>
                  function orderInfo(sn)
                  {
                      var orderSN=sn;

                      $.ajax({
                          url:"<?php echo U('Order/orderInfo');?>",

                          type: 'POST',

                          data:{
                              order_sn:orderSN
                          },

                          dataType: 'html',

                          timeout: 1000,

                          error: function(){alert('Error loading PHP document');},

                          success: function(result){
                              var one=result.split("/");
                              var floatWindow=$(".floatWindow ul li");

                              for(var i=0;i<=floatWindow.length;i++)
                              {
                                  var a=floatWindow.children("span").eq(i).text(one[i]);
                              }
                              $(".floatWindow").show();
                          }
                      });
                  }
              </script>
          </div>
        </div>
          <?php echo ($page); ?>
      </div>
    </div>
  </div>
</div>
<script src="/thinkphp/Public/admin/js/fullcalendar.min.js"></script>
<script src="/thinkphp/Public/admin/js/matrix.calendar.js"></script>
<script src="/thinkphp/Public/admin/js/matrix.tables.js"></script>

<!--Footer-part-->
<div class="row-fluid">
  <div id="footer" class="span12"> 2013 &copy; Matrix Admin. More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a> </div>
</div>
<!--end-Footer-part-->

<script src="/thinkphp/Public/admin/js/matrix.form_common.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.ui.custom.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap.min.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap-colorpicker.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap-datepicker.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.toggle.buttons.html"></script>
<script src="/thinkphp/Public/admin/js/masked.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.uniform.js"></script>
<script src="/thinkphp/Public/admin/js/select2.min.js"></script>
<script src="/thinkphp/Public/admin/js/matrix.js"></script>
<script src="/thinkphp/Public/admin/js/wysihtml5-0.3.0.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.peity.min.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap-wysihtml5.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.dataTables.min.js"></script>
<script src="/thinkphp/Public/admin/js/yanGradyJS/yanGrady.js"></script>
<script>
    $('.textarea_editor').wysihtml5();
</script>
</body>
</html>